/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package VO;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author HELIOS
 */
@Entity
@Table(name = "estudio", catalog = "profesoresfund", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CEstudio.findAll", query = "SELECT c FROM CEstudio c"),
    @NamedQuery(name = "CEstudio.findByIdEstudio", query = "SELECT c FROM CEstudio c WHERE c.idEstudio = :idEstudio"),
    @NamedQuery(name = "CEstudio.findByTitulo", query = "SELECT c FROM CEstudio c WHERE c.titulo = :titulo"),
    @NamedQuery(name = "CEstudio.findByUniversidad", query = "SELECT c FROM CEstudio c WHERE c.universidad = :universidad"),
    @NamedQuery(name = "CEstudio.findByFechaCulminacion", query = "SELECT c FROM CEstudio c WHERE c.fechaCulminacion = :fechaCulminacion")})
public class CEstudio implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idEstudio", nullable = false)
    private Integer idEstudio;
    @Basic(optional = false)
    @Column(name = "titulo", nullable = false, length = 255)
    private String titulo;
    @Basic(optional = false)
    @Column(name = "universidad", nullable = false, length = 255)
    private String universidad;
    @Column(name = "fechaCulminacion")
    @Temporal(TemporalType.DATE)
    private Date fechaCulminacion;
    @JoinColumn(name = "docProfesor", referencedColumnName = "numDocumento", nullable = false)
    @ManyToOne(optional = false)
    private CProfesor docProfesor;

    public CEstudio() {
    }

    public CEstudio(Integer idEstudio) {
        this.idEstudio = idEstudio;
    }

    public CEstudio(Integer idEstudio, String titulo, String universidad) {
        this.idEstudio = idEstudio;
        this.titulo = titulo;
        this.universidad = universidad;
    }

    public Integer getIdEstudio() {
        return idEstudio;
    }

    public void setIdEstudio(Integer idEstudio) {
        this.idEstudio = idEstudio;
    }

    public String getTitulo() {
        return titulo;
    }

    public void setTitulo(String titulo) {
        this.titulo = titulo;
    }

    public String getUniversidad() {
        return universidad;
    }

    public void setUniversidad(String universidad) {
        this.universidad = universidad;
    }

    public Date getFechaCulminacion() {
        return fechaCulminacion;
    }

    public void setFechaCulminacion(Date fechaCulminacion) {
        this.fechaCulminacion = fechaCulminacion;
    }

    public CProfesor getDocProfesor() {
        return docProfesor;
    }

    public void setDocProfesor(CProfesor docProfesor) {
        this.docProfesor = docProfesor;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idEstudio != null ? idEstudio.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CEstudio)) {
            return false;
        }
        CEstudio other = (CEstudio) object;
        if ((this.idEstudio == null && other.idEstudio != null) || (this.idEstudio != null && !this.idEstudio.equals(other.idEstudio))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "fundacionprofesores.CEstudio[ idEstudio=" + idEstudio + " ]";
    }
    
}
